package study.job.elasticjob.support.listener;

import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener;
import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts;

@Slf4j
public class MyJobListener implements ElasticJobListener {

    @Override
    public void beforeJobExecuted(ShardingContexts contexts) {
        contexts.getJobName();
        log.info(">>>>>> beforeJobExecuted");
    }

    @Override
    public void afterJobExecuted(ShardingContexts contexts) {
        log.info(">>>>>> afterJobExecuted");
    }

    @Override
    public String getType() {
        return "MyJobListener";
    }
}
